package com.G3.Screen;

import com.G3.Global.Assets;
import com.G3.Global.Global;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;

public abstract class BaseScreen implements Screen {
	
	protected final Game game;
	protected final Stage stage;

	protected BitmapFont font;
	protected SpriteBatch batch;
	protected TextureAtlas atlas;
	protected Skin skin;

	public BaseScreen(Game game) {
		this.game = game;
		this.stage = new Stage(Global.VIEWPORT_WIDTH, Global.VIEWPORT_HEIGHT, false);
		

		font = Assets.font;
		batch = Assets.batch;
		atlas = Assets.atlas;
		skin = Assets.skin;
	}
	
	@Override
    public void show()
	{
        Gdx.input.setInputProcessor(stage );
    }

    @Override
    public void resize(int width, int height )
    {
    }
    
    public void update(float delta) {
		// TODO Auto-generated method stub
		
	}

    @Override
    public void render(float delta )
    {
    	update(delta);
        stage.act( delta );

        Gdx.gl.glClearColor( 255f, 255f, 255f, 0.3f );
        Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT );

        stage.draw();
    }
    
	@Override
    public void hide()
    {
        // dispose the resources by default
        dispose();
    }

    @Override
    public void pause()
    {
    }

    @Override
    public void resume()
    {
    }

    @Override
    public void dispose()
    {
    }
	
}
